<template>
  <div>
     <div class="banner-box">
         <div class="banner">
             <div class="mycont">
                 我的积分
             </div>
             <div class="mymoney">
                 {{money}} 
             </div>
             <div class="gzinfo" @tap='navToinfo'>
                 规则说明 <image src='/static/images/wenhao.png' class="wenhao"></image>
             </div>
         </div>

		<!-- 当设置tab-width,指定每个tab宽度时,则不使用flex布局,改用水平滑动 -->
<!-- 		<me-tabs v-model="tabIndex" :tabs="tabs" :tab-width="130"></me-tabs> -->
		<swiper :style="{height: height}" :current="tabIndex" @change="swiperChange">
			<swiper-item v-for="(tab,i) in tabs" :key="i">
				<mescroll-item ref="mescrollItem" :i="i" :index="tabIndex" :tabs="tabs" :height="height"></mescroll-item>
			</swiper-item>
		</swiper>


     </div>
  </div>
</template>

<script>
	var a = function (a) {
	  return a && a.__esModule ? a : {
	    default: a
	  };
	}(require("../../utils/api.js")),
	    t = require("../../utils/request.js"),
	    e = require("../../utils/util.js"),
	    app = getApp(),
	    o = a.default.volunteerInfo;
			
import MescrollItem from "./mescroll-swiper-item.vue";
import {prizeList} from '@/api/prizeManage.js'
export default {
 	components: {
		MescrollItem
	},
	data() {
		return {
			money: '1986.00',
			height: "", // 需要固定swiper的高度
			tabs: [{name:'全部'}, {name:'百货'}, {name:'卡卷'}, {name:'其他'}],
			tabIndex: 0, // 当前tab的下标
			pageSize:10,
			pageNo:1
		}
	},
	onLoad() {
		// 需要固定swiper的高度 (需减去悬浮tabs的高度64rpx)
		this.height = uni.getSystemInfoSync().windowHeight - uni.upx2px(360) + 'px'
		if(!app.globalData.token){
			uni.showToast({
				title:"请先登陆"
			}),uni.navigateTo({
				url:"/pages/entry/login"
			})
		}
	},
	onShow() {
		if (app.globalData.loginFlag) {
			var a = this;
			var userInfo = uni.getStorageSync("userInfo")
			this.setData({money:userInfo.integral})
		} 
	},
	methods: {
		navToinfo(){
		    uni.navigateTo({
		        url: '/pages/welfare/info'
		    })
		},
		getVolunteerInfo: function () {
		  var a = {
		    data: {
			api: o,
		      id: app.globalData.zyzId,
			contentType: 'application/x-www-form-urlencoded'
		    }
		  };
		  return (0, t.request)(a, "normal", !0);
		},
		// 轮播菜单
		swiperChange(e){
			this.tabIndex = e.detail.current
		},
		
	}
}
</script>

<style lang='scss' scoped>
    .gzinfo{
        position: absolute;
        right: 30rpx;
        top: 30rpx;
        z-index: 3;
        font-size: 10rpx;
    }
    .mymoney{
        position: absolute;
        left: 30rpx;
        top: 120rpx;
        font-size: 50rpx;
        z-index: 3;
    }
    .mycont{
        position: absolute;
        left: 30rpx;
        top: 30rpx;
        z-index: 3;
    }
    .banner-box{
        padding:30rpx;
   
        
    }
    .banner{
        width: 670rpx;
        height: 230rpx;
        background-image: url('~@/static/images/fulibanner.png');
        background-size: 100% 100%;
        color: #fff;
        position: relative;
        display: block;
        margin: 0 auto;
    }
    .wenhao{
        width: 24rpx;
        height: 24rpx;
    }
</style>